#pragma once
#include <cstdint>
#include <memory>
#include <string>
#include <vector>

#include "result.hpp"

class BroadcastSender
{
public:
    explicit BroadcastSender();
    ~BroadcastSender();

    cpp::Result<> init(uint16_t port, const std::string& interface_address = "0.0.0.0") const;

    void release() const;

    cpp::Result<> send(const std::vector<uint8_t>& data) const;

private:
    class Impl;
    std::unique_ptr<Impl> pimpl;
};
